package com.ezjie.ielts.task;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

import com.ezjie.ielts.core.http.HttpAPI;
import com.ezjie.ielts.core.http.HttpRequestCallBack;
import com.ezjie.ielts.core.http.ServerInterfaceDefinition;
import com.lidroid.xutils.http.RequestParams;

import android.content.Context;

public class UploadPhotoTask {

	private Context context;

	public UploadPhotoTask(Context context) {
		this.context = context;
	}

	/**
	 * 上传头像
	 * 
	 * @param httpRequestCallBack
	 */
	public void uploadPhoto(String uploadPath, HttpRequestCallBack httpRequestCallBack) {

		Map<String, File> files = new HashMap<String, File>();
		files.put("image", new File(uploadPath));
		
		HttpAPI.getInstance(context,true).doUploadFileRequest(
				ServerInterfaceDefinition.OPT_USER_IMAGE,null, files,
				httpRequestCallBack);
	}

}
